# coding:utf-8

# total 5*2

# 01
# for i in range(5):
#     i += 1
#     print("-------")
#     if i == 3:
#         continue
#     print(i)

# 02
# x = y = z = 1
# x, y = y, x
# x += y
# # x = (y = z + 1)  # SyntaxError: invalid syntax
# x = (y == z + 1)

# # 4
# list = ['1', '2', '3', '4', '5']
# print(len(list))  # 5
# print(list[10:])  # []
# print(list[10:15])  # []
# print(list[1:18])  # ['2', '3', '4', '5']

# 05
# a = range(5)
# print(type(a))
# print(a)
# # <class 'range'>
# # range(0, 5)
#
# print(a[-3])  # 2
# print(a[2:13])  # range(2, 5)
# print(a[::3])  # range(0, 5, 3)
# print(a[2-3])  # 4


# 03
import re
str1 = "Python's features"
str2 = re.match(r'(.*)on(.*?) .*', str1, re.M | re.I)
print(str2.group())
print(str2.group(1))
print(str2.group(2))
print(type(str2), str2)
# Python's features
# Pyth
# 's
# <class '_sre.SRE_Match'> <_sre.SRE_Match object; span=(0, 17), match="Python's features">
